/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.ope.be;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author GABRIEL
 */
@Entity
@Table(name = "OPE_DETALLE_CARGOS_NOTA")
@NamedQueries({@NamedQuery(name = "DetalleCargosNota.findAll", query = "SELECT d FROM DetalleCargosNota d"), @NamedQuery(name = "DetalleCargosNota.findByIdDetalleCargosNota", query = "SELECT d FROM DetalleCargosNota d WHERE d.idDetalleCargosNota = :idDetalleCargosNota"), @NamedQuery(name = "DetalleCargosNota.findByNombre", query = "SELECT d FROM DetalleCargosNota d WHERE d.nombre = :nombre")})
public class DetalleCargosNota implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_DETALLE_CARGOS_NOTA", nullable = false)
    private Integer idDetalleCargosNota;
    @Column(name = "NOMBRE", length = 50)
    private String nombre;
    @OneToMany(mappedBy = "fidOpeDetalleCargosNota", fetch = FetchType.LAZY)
    private List<CargosNota> cargosNotaCollection;

    public DetalleCargosNota() {
    }

    public DetalleCargosNota(Integer idDetalleCargosNota) {
        this.idDetalleCargosNota = idDetalleCargosNota;
    }

    public Integer getIdDetalleCargosNota() {
        return idDetalleCargosNota;
    }

    public void setIdDetalleCargosNota(Integer idDetalleCargosNota) {
        this.idDetalleCargosNota = idDetalleCargosNota;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public List<CargosNota> getCargosNotaCollection() {
        return cargosNotaCollection;
    }

    public void setCargosNotaCollection(List<CargosNota> cargosNotaCollection) {
        this.cargosNotaCollection = cargosNotaCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDetalleCargosNota != null ? idDetalleCargosNota.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DetalleCargosNota)) {
            return false;
        }
        DetalleCargosNota other = (DetalleCargosNota) object;
        if ((this.idDetalleCargosNota == null && other.idDetalleCargosNota != null) || (this.idDetalleCargosNota != null && !this.idDetalleCargosNota.equals(other.idDetalleCargosNota))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.ope.be.DetalleCargosNota[idDetalleCargosNota=" + idDetalleCargosNota + "]";
    }

}
